<template>
  <div>
      <el-form ref="form" :model="formData"  method="post" action="/youyaboot-admin/magical_lowcode/crud/user/insert">
      		<el-form-item label="姓名" prop="userName" :rules="[{required:true,message:'不能为空'}]">
      			<el-input v-model="formData.userName" placeholder="请输入内容"></el-input>
      		</el-form-item>
      		<el-form-item label="性别">
      			<el-radio-group v-model="sex">
      				<el-radio label="0">女</el-radio>
      				<el-radio label="1">男</el-radio>
      			</el-radio-group>
      		</el-form-item>
      		<el-form-item label="创建日期">
      			<el-date-picker v-model="createTime" :editable="true" :clearable="true" type="datetime" format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
      		</el-form-item>
      		<el-form-item label="年龄">
      			<el-slider v-model="age"></el-slider>
      		</el-form-item>
			<el-form-item>
      			<el-button @click="submit()">提交</el-button>
      		</el-form-item>
      	</el-form>
  </div>
</template>

<script>
import McForm from './components/McForm'
export default {
    data(){
      return {
		  formData:{ 
			userName:"",
			sex:"2",
			createTime:"",
			age:3,
		  },
        userName:"1",
        sex:"2",
        createTime:"",
        age:3,
      }
    },
    components:{
      McForm,
    },
	methods:{ 
		submit(){
			this.$refs.form.validate((valid) => {
				if (valid) {
					alert('submit!');
				} else {
					console.log('error submit!!');
					return false;
				}
				});
		}
	}
}
</script>

<style>

</style>
